Optimal. Leaf size=223 \[ \frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (3 a^2 f h^2-4 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{8 c^{5/2}}-\frac{\sqrt{a+c x^2} \left (4 \left (4 a h^2 (e h+2 f g)+c g \left (f g^2-4 h (3 d h+e g)\right )\right )-h x \left (3 h^2 (4 c d-3 a f)-2 c g (f g-4 e h)\right )\right )}{24 c^2 h}-\frac{\sqrt{a+c x^2} (g+h x)^2 (f g-4 e h)}{12 c h}+\frac{f \sqrt{a+c x^2} (g+h x)^3}{4 c h} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.372031, antiderivative size = 222, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 5, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.172, Rules used = {1654, 833, 780, 217, 206} \[ \frac{\tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (3 a^2 f h^2-4 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )}{8 c^{5/2}}-\frac{\sqrt{a+c x^2} \left (4 \left (4 a h^2 (e h+2 f g)-4 c g h (3 d h+e g)+c f g^3\right )-h x \left (3 h^2 (4 c d-3 a f)-2 c g (f g-4 e h)\right )\right )}{24 c^2 h}-\frac{\sqrt{a+c x^2} (g+h x)^2 (f g-4 e h)}{12 c h}+\frac{f \sqrt{a+c x^2} (g+h x)^3}{4 c h} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 1654
Rule 833
Rule 780
Rule 217
Rule 206
Rubi steps
\begin{align*} \int \frac{(g+h x)^2 \left (d+e x+f x^2\right )}{\sqrt{a+c x^2}} \, dx &=\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}+\frac{\int \frac{(g+h x)^2 \left ((4 c d-3 a f) h^2-c h (f g-4 e h) x\right )}{\sqrt{a+c x^2}} \, dx}{4 c h^2}\\ &=-\frac{(f g-4 e h) (g+h x)^2 \sqrt{a+c x^2}}{12 c h}+\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}+\frac{\int \frac{(g+h x) \left (c h^2 (12 c d g-7 a f g-8 a e h)+c h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right )}{\sqrt{a+c x^2}} \, dx}{12 c^2 h^2}\\ &=-\frac{(f g-4 e h) (g+h x)^2 \sqrt{a+c x^2}}{12 c h}+\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}-\frac{\left (4 \left (c f g^3-4 c g h (e g+3 d h)+4 a h^2 (2 f g+e h)\right )-h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right ) \sqrt{a+c x^2}}{24 c^2 h}+\frac{\left (8 c^2 d g^2+3 a^2 f h^2-4 a c \left (f g^2+h (2 e g+d h)\right )\right ) \int \frac{1}{\sqrt{a+c x^2}} \, dx}{8 c^2}\\ &=-\frac{(f g-4 e h) (g+h x)^2 \sqrt{a+c x^2}}{12 c h}+\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}-\frac{\left (4 \left (c f g^3-4 c g h (e g+3 d h)+4 a h^2 (2 f g+e h)\right )-h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right ) \sqrt{a+c x^2}}{24 c^2 h}+\frac{\left (8 c^2 d g^2+3 a^2 f h^2-4 a c \left (f g^2+h (2 e g+d h)\right )\right ) \operatorname{Subst}\left (\int \frac{1}{1-c x^2} \, dx,x,\frac{x}{\sqrt{a+c x^2}}\right )}{8 c^2}\\ &=-\frac{(f g-4 e h) (g+h x)^2 \sqrt{a+c x^2}}{12 c h}+\frac{f (g+h x)^3 \sqrt{a+c x^2}}{4 c h}-\frac{\left (4 \left (c f g^3-4 c g h (e g+3 d h)+4 a h^2 (2 f g+e h)\right )-h \left (3 (4 c d-3 a f) h^2-2 c g (f g-4 e h)\right ) x\right ) \sqrt{a+c x^2}}{24 c^2 h}+\frac{\left (8 c^2 d g^2+3 a^2 f h^2-4 a c \left (f g^2+h (2 e g+d h)\right )\right ) \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right )}{8 c^{5/2}}\\ \end{align*}
Mathematica [A] time = 0.249788, size = 164, normalized size = 0.74 \[ \frac{3 \tanh ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a+c x^2}}\right ) \left (3 a^2 f h^2-4 a c \left (h (d h+2 e g)+f g^2\right )+8 c^2 d g^2\right )+\sqrt{c} \sqrt{a+c x^2} \left (2 c \left (6 d h (4 g+h x)+4 e \left (3 g^2+3 g h x+h^2 x^2\right )+f x \left (6 g^2+8 g h x+3 h^2 x^2\right )\right )-a h (16 e h+32 f g+9 f h x)\right )}{24 c^{5/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.061, size = 339, normalized size = 1.5 \begin{align*}{\frac{{h}^{2}f{x}^{3}}{4\,c}\sqrt{c{x}^{2}+a}}-{\frac{3\,af{h}^{2}x}{8\,{c}^{2}}\sqrt{c{x}^{2}+a}}+{\frac{3\,{a}^{2}f{h}^{2}}{8}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{5}{2}}}}+{\frac{{h}^{2}{x}^{2}e}{3\,c}\sqrt{c{x}^{2}+a}}+{\frac{2\,{x}^{2}ghf}{3\,c}\sqrt{c{x}^{2}+a}}-{\frac{2\,a{h}^{2}e}{3\,{c}^{2}}\sqrt{c{x}^{2}+a}}-{\frac{4\,aghf}{3\,{c}^{2}}\sqrt{c{x}^{2}+a}}+{\frac{dx{h}^{2}}{2\,c}\sqrt{c{x}^{2}+a}}+{\frac{egxh}{c}\sqrt{c{x}^{2}+a}}+{\frac{fx{g}^{2}}{2\,c}\sqrt{c{x}^{2}+a}}-{\frac{ad{h}^{2}}{2}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}-{aegh\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}-{\frac{af{g}^{2}}{2}\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){c}^{-{\frac{3}{2}}}}+2\,{\frac{\sqrt{c{x}^{2}+a}ghd}{c}}+{\frac{e{g}^{2}}{c}\sqrt{c{x}^{2}+a}}+{{g}^{2}d\ln \left ( x\sqrt{c}+\sqrt{c{x}^{2}+a} \right ){\frac{1}{\sqrt{c}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 2.18368, size = 871, normalized size = 3.91 \begin{align*} \left [-\frac{3 \,{\left (8 \, a c e g h - 4 \,{\left (2 \, c^{2} d - a c f\right )} g^{2} +{\left (4 \, a c d - 3 \, a^{2} f\right )} h^{2}\right )} \sqrt{c} \log \left (-2 \, c x^{2} - 2 \, \sqrt{c x^{2} + a} \sqrt{c} x - a\right ) - 2 \,{\left (6 \, c^{2} f h^{2} x^{3} + 24 \, c^{2} e g^{2} - 16 \, a c e h^{2} + 16 \,{\left (3 \, c^{2} d - 2 \, a c f\right )} g h + 8 \,{\left (2 \, c^{2} f g h + c^{2} e h^{2}\right )} x^{2} + 3 \,{\left (4 \, c^{2} f g^{2} + 8 \, c^{2} e g h +{\left (4 \, c^{2} d - 3 \, a c f\right )} h^{2}\right )} x\right )} \sqrt{c x^{2} + a}}{48 \, c^{3}}, \frac{3 \,{\left (8 \, a c e g h - 4 \,{\left (2 \, c^{2} d - a c f\right )} g^{2} +{\left (4 \, a c d - 3 \, a^{2} f\right )} h^{2}\right )} \sqrt{-c} \arctan \left (\frac{\sqrt{-c} x}{\sqrt{c x^{2} + a}}\right ) +{\left (6 \, c^{2} f h^{2} x^{3} + 24 \, c^{2} e g^{2} - 16 \, a c e h^{2} + 16 \,{\left (3 \, c^{2} d - 2 \, a c f\right )} g h + 8 \,{\left (2 \, c^{2} f g h + c^{2} e h^{2}\right )} x^{2} + 3 \,{\left (4 \, c^{2} f g^{2} + 8 \, c^{2} e g h +{\left (4 \, c^{2} d - 3 \, a c f\right )} h^{2}\right )} x\right )} \sqrt{c x^{2} + a}}{24 \, c^{3}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 13.7865, size = 518, normalized size = 2.32 \begin{align*} - \frac{3 a^{\frac{3}{2}} f h^{2} x}{8 c^{2} \sqrt{1 + \frac{c x^{2}}{a}}} + \frac{\sqrt{a} d h^{2} x \sqrt{1 + \frac{c x^{2}}{a}}}{2 c} + \frac{\sqrt{a} e g h x \sqrt{1 + \frac{c x^{2}}{a}}}{c} + \frac{\sqrt{a} f g^{2} x \sqrt{1 + \frac{c x^{2}}{a}}}{2 c} - \frac{\sqrt{a} f h^{2} x^{3}}{8 c \sqrt{1 + \frac{c x^{2}}{a}}} + \frac{3 a^{2} f h^{2} \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{8 c^{\frac{5}{2}}} - \frac{a d h^{2} \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{2 c^{\frac{3}{2}}} - \frac{a e g h \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{c^{\frac{3}{2}}} - \frac{a f g^{2} \operatorname{asinh}{\left (\frac{\sqrt{c} x}{\sqrt{a}} \right )}}{2 c^{\frac{3}{2}}} + d g^{2} \left (\begin{cases} \frac{\sqrt{- \frac{a}{c}} \operatorname{asin}{\left (x \sqrt{- \frac{c}{a}} \right )}}{\sqrt{a}} & \text{for}\: a > 0 \wedge c < 0 \\\frac{\sqrt{\frac{a}{c}} \operatorname{asinh}{\left (x \sqrt{\frac{c}{a}} \right )}}{\sqrt{a}} & \text{for}\: a > 0 \wedge c > 0 \\\frac{\sqrt{- \frac{a}{c}} \operatorname{acosh}{\left (x \sqrt{- \frac{c}{a}} \right )}}{\sqrt{- a}} & \text{for}\: c > 0 \wedge a < 0 \end{cases}\right ) + 2 d g h \left (\begin{cases} \frac{x^{2}}{2 \sqrt{a}} & \text{for}\: c = 0 \\\frac{\sqrt{a + c x^{2}}}{c} & \text{otherwise} \end{cases}\right ) + e g^{2} \left (\begin{cases} \frac{x^{2}}{2 \sqrt{a}} & \text{for}\: c = 0 \\\frac{\sqrt{a + c x^{2}}}{c} & \text{otherwise} \end{cases}\right ) + e h^{2} \left (\begin{cases} - \frac{2 a \sqrt{a + c x^{2}}}{3 c^{2}} + \frac{x^{2} \sqrt{a + c x^{2}}}{3 c} & \text{for}\: c \neq 0 \\\frac{x^{4}}{4 \sqrt{a}} & \text{otherwise} \end{cases}\right ) + 2 f g h \left (\begin{cases} - \frac{2 a \sqrt{a + c x^{2}}}{3 c^{2}} + \frac{x^{2} \sqrt{a + c x^{2}}}{3 c} & \text{for}\: c \neq 0 \\\frac{x^{4}}{4 \sqrt{a}} & \text{otherwise} \end{cases}\right ) + \frac{f h^{2} x^{5}}{4 \sqrt{a} \sqrt{1 + \frac{c x^{2}}{a}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.17298, size = 278, normalized size = 1.25 \begin{align*} \frac{1}{24} \, \sqrt{c x^{2} + a}{\left ({\left (2 \,{\left (\frac{3 \, f h^{2} x}{c} + \frac{4 \,{\left (2 \, c^{3} f g h + c^{3} h^{2} e\right )}}{c^{4}}\right )} x + \frac{3 \,{\left (4 \, c^{3} f g^{2} + 4 \, c^{3} d h^{2} - 3 \, a c^{2} f h^{2} + 8 \, c^{3} g h e\right )}}{c^{4}}\right )} x + \frac{8 \,{\left (6 \, c^{3} d g h - 4 \, a c^{2} f g h + 3 \, c^{3} g^{2} e - 2 \, a c^{2} h^{2} e\right )}}{c^{4}}\right )} - \frac{{\left (8 \, c^{2} d g^{2} - 4 \, a c f g^{2} - 4 \, a c d h^{2} + 3 \, a^{2} f h^{2} - 8 \, a c g h e\right )} \log \left ({\left | -\sqrt{c} x + \sqrt{c x^{2} + a} \right |}\right )}{8 \, c^{\frac{5}{2}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]